﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Web.Framework.Svc
{
    [DataContract]
    [Serializable]
    public class ServiceOptions
    {
        public ServiceOptions()
        {
            Operations = new List<string>();
        }

        public bool UsePages 
        {
            get
            {
                //return PageSize != 0;
                return false;
            }
        }

        [DataMember]
        public int PageSize { get; set; }

        [DataMember]
        public int PageNumber { get; set; }

        public int GetSkip()
        {
            return PageSize * PageNumber;
        }

        [DataMember]
        public int UserId { get; set; }

        [DataMember]
        public string UserName { get; set; }

        [DataMember]
        public int CompanyId { get; set; }

        [DataMember]
        public int ApplicationId { get; set; }

        [DataMember]
        public List<string> Operations { get; set; }

        [DataMember]
        public bool IsAdmin { get; set; }

    }
}
